package com.king.config;

import com.king.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

//Configuration 相当于beans
@Configuration
@ComponentScan("com.king.pojo") //扫描
@Import(JavaConfig.class) //导入
public class JavaConfig {

    //注册一个bean,相当于xml的bean标签
    //方法名相当于beanid
    //放回值相当于bean的class属性
    @Bean
    public User getUser(){
        return new User();
    }
}
